home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / ti1006.exe / TI1006.ASC < prev   
Text File  |  1993-02-25  |  7KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Borland C++                           NUMBER  :  1006
  9.   VERSION  :  3.0
  10.        OS  :  DOS
  11.      DATE  :  February 25, 1993                        PAGE  :  1/4
  12.  
  13.     TITLE  :  Overlaying Turbo Vision
  14.  
  15.  
  16.  
  17.  
  18.  
  19.   BACKGROUND
  20.   ==========
  21.  
  22.   In order to create an overlaid Turbo Vision program, one must
  23.   have the Turbo Vision Source code and a copy of Turbo Assembler
  24.   (v2.5x, or above).  If you have problems with the assembler
  25.   running out of memory, download TI1331, which will explain how to
  26.   run TASMX, the DPMI protected mode assembler, from the IDE or
  27.   from BCC.
  28.  
  29.  
  30.   OVERVIEW
  31.   ========
  32.  
  33.   1. Rebuild the Turbo Vision Library to include overlay support
  34.   and move certain non-overlayable object modules to a second
  35.   library.
  36.  
  37.   2. Set up a project file for the overlaid program and make sure
  38.   that all the correct options are set for overlaid program,
  39.   including -Vs and -B.  If you prefer using the command line
  40.   tools, you can create an analogous Makefile.
  41.  
  42.   3. Add TV.LIB and the second library you created in step one,
  43.   above, to the project and mark TV.LIB as overlayable.
  44.  
  45.  
  46.   REBUILDING FOR OVERLAYS
  47.   =======================
  48.  
  49.   In order to use Turbo Vision in an overlaid program, TV.LIB must
  50.   be rebuilt.  Change directory to the Turbo Vision Source code
  51.   directory (ex. C:\BORLANDC\TVISION\SOURCE ) and run this command:
  52.  
  53.        MAKE -B -DOVERLAY
  54.  
  55.   This will generate a new copy of TV.LIB which can be overlayed.
  56.   It will also create two .OBJ files, SYSINT.OBJ and TEVENT.OBJ.
  57.   These two files contain code for TV's interrupt handlers and
  58.   cannot be overlayed.  In addition, there are a few other OBJ
  59.   files still in the library which cannot be overlaid either since
  60.   they include code that could be called from Turbo Vision's
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Borland C++                           NUMBER  :  1006
  75.   VERSION  :  3.0
  76.        OS  :  DOS
  77.      DATE  :  February 25, 1993                        PAGE  :  2/4
  78.  
  79.     TITLE  :  Overlaying Turbo Vision
  80.  
  81.  
  82.  
  83.  
  84.   critical error handler.  These can be extracted from the library
  85.   with the following command:
  86.  
  87.        TLIB TV.LIB -*SYSERR -*TSCREEN -*DRIVERS -*DRIVERS2
  88.             -*SWAPST
  89.  
  90.   Create a new library called TVNO.LIB that consists of the
  91.   aforementioned OBJ files that should not be overlaid.  Use the
  92.   following command to do this:
  93.  
  94.        TLIB TVNO.LIB -+TEVENT -+SYSINT -+TSCREEN -+SYSERR
  95.             -+DRIVERS -+DRIVERS2 -+SWAPST
  96.  
  97.  
  98.   SETTING UP THE PROJECT
  99.   ======================
  100.  
  101.   Create a project file that includes all the source modules and
  102.   libraries used by your program.
  103.  
  104.   First, go to Options|Application and select <Dos Overlay>.  Then
  105.   sure to set the following options:
  106.  
  107.        Options|Compiler|Code Generation : Large Model
  108.        Options|Compiler|Code Generation : Compile Via Assembler
  109.        Options|Compiler|C++ Options : Local Virtual Tables
  110.        Options|Linker|Libraries : Unmark Turbo Vision
  111.  
  112.   Of course if there are any other options needed for the project,
  113.   such as <Word Alignment> or <Optimizations> set those at this
  114.   time, as well as marking the appropriate modules in the project
  115.   to be overlaid or not as desired.
  116.  
  117.  
  118.   OVERLAYING TV.LIB
  119.   =================
  120.  
  121.   Now, add TV.LIB and TVNO.LIB to the project.  In their respective
  122.   local options screens, mark <Overlay This Module> for TV.LIB and
  123.   leave it blank for TVNO.LIB.  It is imperative that TVNO.LIB not
  124.   be overlaid.
  125.  
  126.   Now select <Compile | Build All> to build the program.
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  Borland C++                           NUMBER  :  1006
  141.   VERSION  :  3.0
  142.        OS  :  DOS
  143.      DATE  :  February 25, 1993                        PAGE  :  3/4
  144.  
  145.     TITLE  :  Overlaying Turbo Vision
  146.  
  147.  
  148.  
  149.  
  150.   COMMAND LINE EQUIVALENTS
  151.   ========================
  152.  
  153.   If using a Makefile and the command line tools, the following
  154.   options for BCC are equivalent to the options listed in step 2:
  155.  
  156.        -Y, -Yo        Compile for Overlays
  157.        -ml            Large Model
  158.        -B             Compile Via Assembler
  159.        -Vs            Local Virtual Tables
  160.  
  161.   Your command line will look something like this:
  162.  
  163.        bcc -Vs -B -ml -Yo myfile.cpp -Yo- tvno.lib -Yo tv.lib
  164.  
  165.  
  166.   IMPORTANT!!
  167.   ===========
  168.  
  169.   Be sure to use the same BC switches outlined in the makefile when
  170.   compiling your source code to be overlayed with the new overlayed
  171.   Turbo Vision library! (i.e. use the -Vs and -B switches  -  In
  172.   the IDE use OPTIONS|COMPILER|C++ OPTIONS|LOCAL VIRTUAL TABLES
  173.   and  OPTIONS|COMPILER|CODE GENERATION|COMPILE VIA ASSEMBLER ).
  174.  
  175.  
  176.   TROUBLESHOOTING
  177.   ===============
  178.  
  179.   If the assembler runs out of memory when assembling one of the
  180.   files built by the compiler, use TASMX, the protected mode
  181.   assembler, instead.  Download TI1331 for instructions on how to
  182.   set up the Assember Transfer item to call TASMX.
  183.  
  184.   If warning "No stub for fixup at SEGMENT:XXXXh in module MODULE"
  185.   is generated, most likely not all modules in the project are
  186.   being compiled with -B and -Vs, or that the Turbo Vision library
  187.   was not compiled with overlay support.  Double check that the
  188.   steps in this document have all been followed correctly and
  189.   rebuild the program with <Compile | Build All>.
  190.  
  191.  
  192.   INCREASING PERFOMANCE
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.   PRODUCT  :  Borland C++                           NUMBER  :  1006
  207.   VERSION  :  3.0
  208.        OS  :  DOS
  209.      DATE  :  February 25, 1993                        PAGE  :  4/4
  210.  
  211.     TITLE  :  Overlaying Turbo Vision
  212.  
  213.  
  214.  
  215.  
  216.   =====================
  217.  
  218.   To improve performance of an overlaid Turbo Vision application it
  219.   may be helpful to increase the size of the global variable
  220.   __ovrbuffer to 0x2000 or greater.  This will set up an 128K
  221.   overlay buffer.
  222.  
  223.  
  224.   EXAMPLE
  225.   =======
  226.  
  227.   Here are explicit instructions for overlaying the TVFORMS program
  228.   in TVISION\DEMOS.  These instructions assume that the Turbo
  229.   Vision library has been recompiled for Overlay support as
  230.   described above:
  231.  
  232.        - Change directory to \BORLANDC\TVISION\DEMOS
  233.        - Run BC and open TVFORMS.PRJ as a project.
  234.        - Make these changes:
  235.             Options | Application : Choose DOS Overlaid.
  236.             Options | Compiler | Code generation : Reset to Large
  237.                                                    Model
  238.             Options | Compiler | Code generation : Select compile
  239.                                                    via Assembler
  240.             Options | Compiler | C++ options : Select Local Virtual
  241.                                                Tables
  242.             Options | Linker | Libraries : Uncheck Turbo Vision
  243.        - Add TV.LIB and TVNO.LIB to the project file.
  244.        - In the project window, select TV.LIB and any other source
  245.        module you wish to overlay.  On each, select the name, type
  246.        <Ctrl-O> and mark <Overlay This Module> on the Local Menu
  247.        Dialog that appears.
  248.        - Do not overlay TVNO.LIB.
  249.        - Selecting <Compile | Build All> will now build an overlaid
  250.          version of TVFORMS.
  251.  
  252.  
  253.  
  254.  
  255.   DISCLAIMER: You have the right to use this technical information
  256.   subject to the terms of the No-Nonsense License Statement that
  257.   you received with the Borland product to which this information
  258.   pertains.
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.